<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo CHtml::encode($this->pageTitle); ?></title>
<script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/static/js/jquery.js"></script>
<script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/static/js/artdialog/jquery.artDialog.js?skin=default"></script>
<script type="text/javascript" src="<?php echo Yii::app()->request->baseUrl; ?>/static/js/artdialog/plugins/iframeTools.js"></script>
<style type="text/css">
* { padding: 0; margin: 0; }
body {  font-size: 12px; }
.aui_state_focus .aui_close { display: none; }
.aui_state_focus .aui_main {text-align: left; font-size: 14px;}
.time-info { margin-top: 10px; font-size: 12px; color: #999 }
.aui_content p.msg-content { line-height: 1.6 }
</style>

<script type="text/javascript">
$(function(){
    $.dialog({
        'title': '<?php echo Yii::t('app', 'Warm tips');?>',
        'content': '<p class="msg-content"><?php echo $message;?></p><p class="time-info"><?php echo Yii::t('app', 'Page will redirect in {seconds}.', array('{seconds}' => ' <span id="time-left">'.$waitTime.'</span> '));?></p>',
        'width': 450,
        'icon': '<?php echo $status == Constants::OPERATION_SUCCEED ? 'succeed' : 'error';?>',
        'ok': function()
        {
            location.href ="<?php echo $forwardUrl;?>";
        },
        'drag': false,
        'resize': false,
        'esc': false,
        'lock': true,
        'opacity': .3
    });
});

setTimeout('location.href = "<?php echo $forwardUrl;?>"', <?php echo $waitTime * 1000;?>);
var handle = setInterval(function(){
    var currentSecond = $('#time-left').text();

    if (parseInt(currentSecond) === 1)
    {
        clearInterval(handle);
    }
    else
    {
        $('#time-left').text(currentSecond - 1);
    }
}, 1000);
</script>
</head>

<body>
<?php if ($otherScript):?>
<?php echo $otherScript;?>
<?php endif;?>
</body>
</html>